package com.five.myapplication;

import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;

/**
 * Created by ouyangshen on 2017/10/7.
 */
public class MainActivity extends AppCompatActivity implements OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.btn_date_picker).setOnClickListener(this);
        findViewById(R.id.btn_time_picker).setOnClickListener(this);
        findViewById(R.id.btn_base_adapter).setOnClickListener(this);
        findViewById(R.id.btn_list_view).setOnClickListener(this);
        findViewById(R.id.btn_list_cart).setOnClickListener(this);
        findViewById(R.id.btn_grid_view).setOnClickListener(this);
        findViewById(R.id.btn_grid_channel).setOnClickListener(this);
        findViewById(R.id.btn_view_pager).setOnClickListener(this);
        findViewById(R.id.btn_title_strip).setOnClickListener(this);
        findViewById(R.id.btn_tab_strip).setOnClickListener(this);
        findViewById(R.id.btn_launch_simple).setOnClickListener(this);
        findViewById(R.id.btn_fragment_static).setOnClickListener(this);
        findViewById(R.id.btn_fragment_dynamic).setOnClickListener(this);
        findViewById(R.id.btn_launch_improve).setOnClickListener(this);
        findViewById(R.id.btn_broad_temp).setOnClickListener(this);
        findViewById(R.id.btn_broad_system).setOnClickListener(this);
        findViewById(R.id.btn_alarm).setOnClickListener(this);
        findViewById(R.id.btn_month_picker).setOnClickListener(this);
        findViewById(R.id.btn_calendar).setOnClickListener(this);
        findViewById(R.id.btn_vibrator).setOnClickListener(this);
        findViewById(R.id.btn_schedule).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_date_picker) {
            Intent intent = new Intent(this, DatePickerActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_time_picker) {
            Intent intent = new Intent(this, TimePickerActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_base_adapter) {//基本适配器
            Intent intent = new Intent(this, BaseAdapterActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_list_view) {//列表视图
            Intent intent = new Intent(this, ListViewActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_list_cart) {//购物列表
            Intent intent = new Intent(this, ShoppingCartActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_grid_view) {//网格视图
            Intent intent = new Intent(this, GridViewActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_grid_channel) {//手机商场网格视图
            Intent intent = new Intent(this, ShoppingChannelActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_view_pager) {
            Intent intent = new Intent(this, ViewPagerActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_title_strip) {//文本标题
            Intent intent = new Intent(this, PagerTitleStripActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_tab_strip) {//选项卡标题
            Intent intent = new Intent(this, PagerTabStripActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_launch_simple) {//简单的启动页
            Intent intent = new Intent(this, LaunchSimpleActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_fragment_static) {//静态注册
            Intent intent = new Intent(this, FragmentStaticActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_fragment_dynamic) {//动态注册
            Intent intent = new Intent(this, FragmentDynamicActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_launch_improve) {//改进的启动引导页
            Intent intent = new Intent(this, LaunchImproveActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_broad_temp) {//broad_temp接收发送临时广播
            Intent intent = new Intent(this, BroadTempActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_broad_system) {//接收系统广播
            Intent intent = new Intent(this, BroadSystemActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_alarm) {//定时器
            Intent intent = new Intent(this, AlarmActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_month_picker) {//月份选择器
            Intent intent = new Intent(this, MonthPickerActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_calendar) {//万年历
            Intent intent = new Intent(this, CalendarActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_vibrator) {//振动器
            Intent intent = new Intent(this, VibratorActivity.class);
            startActivity(intent);
        } else if (v.getId() == R.id.btn_schedule) {//日程表
            Intent intent = new Intent(this, ScheduleActivity.class);
            startActivity(intent);
        }
    }

}
